/* 通用样式 - 主体样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f7fa;
    min-height: 100vh;
    color: #333;
    font-size: 14px;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 260px;
    background: linear-gradient(160deg, #2c3e50, #1a2530);
    color: white;
    padding: 20px 0;
    box-shadow: 3px 0 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 100;
    height: 100vh;
    position: fixed;
}

.sidebar.collapsed {
    width: 70px;
}

.logo {
    text-align: center;
    padding: 0 15px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 25px;
}

.logo h2 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sidebar.collapsed .logo h2 {
    font-size: 14px;
}

.sidebar.collapsed .logo-text {
    display: none;
}

.toggle-btn {
    position: absolute;
    top: 20px;
    right: -12px;
    background: #3498db;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.sidebar.collapsed .toggle-btn {
    transform: rotate(180deg);
}

.sidebar ul {
    list-style: none;
    padding: 0 10px;
}

.sidebar li {
    margin-bottom: 8px;
}

.sidebar a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    font-size: 15px;
    position: relative;
    overflow: hidden;
}

.sidebar a:hover, .sidebar a.active {
    background-color: rgba(52, 152, 219, 0.2);
    color: white;
    transform: translateX(5px);
}

.sidebar a.active {
    background-color: #3498db;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.sidebar a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #fff;
}

.menu-icon {
    width: 24px;
    margin-right: 15px;
    text-align: center;
    font-size: 18px;
}

.sidebar.collapsed .menu-text {
    display: none;
}

.sidebar.collapsed .menu-icon {
    margin-right: 0;
    font-size: 20px;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
    margin-left: 260px;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 70px;
}

/* 头部样式 */
.header {
    background: linear-gradient(120deg, #2c3e50, #3498db);
    padding: 20px 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.header h1 {
    color: white;
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
}

.logout-btn {
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.logout-btn:hover {
    background: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* 内容区域 */
.content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #f5f7fa;
}

.page-title {
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title::before {
    content: '';
    display: block;
    width: 5px;
    height: 30px;
    background: linear-gradient(to bottom, #3498db, #2c3e50);
    border-radius: 3px;
}

/* 首页内容 */
.welcome-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    margin-bottom: 35px;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
}

.welcome-card h2 {
    margin-bottom: 20px;
    font-size: 32px;
    position: relative;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.welcome-card p {
    line-height: 1.8;
    opacity: 0.95;
    font-size: 17px;
    position: relative;
    max-width: 800px;
}

/* 功能卡片网格 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 25px;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    cursor: pointer;
    border: 1px solid #eee;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #9b59b6);
}

.card-icon {
    font-size: 42px;
    margin-bottom: 20px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    transition: all 0.3s;
}

.card:hover .card-icon {
    transform: scale(1.1);
    background: rgba(52, 152, 219, 0.2);
}

.card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 600;
}

.card p {
    color: #7f8c8d;
    font-size: 15px;
    line-height: 1.6;
}

/* 管理页面样式 */
.management-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    display: none;
}

.management-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.management-header h2 {
    color: #2c3e50;
    font-size: 26px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.3s;
}

/* 统一操作按钮样式 */
.action-btn {
    padding: 8px 15px;
    margin: 0 5px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.edit-btn {
    background: linear-gradient(120deg, #f39c12, #e67e22);
    color: white;
    box-shadow: 0 3px 8px rgba(243, 156, 18, 0.3);
}

.delete-btn {
    background: linear-gradient(120deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 3px 8px rgba(231, 76, 60, 0.3);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important;
}

/* 底部样式 */
.footer {
    background: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 20px;
    font-size: 15px;
    margin-top: auto;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }

    .sidebar .menu-text {
        display: none;
    }

    .sidebar .menu-icon {
        margin-right: 0;
        font-size: 20px;
    }

    .sidebar .logo h2 .logo-text {
        display: none;
    }

    .sidebar .toggle-btn {
        transform: rotate(180deg);
    }

    .main-content {
        margin-left: 70px;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 15px 0;
        height: auto;
        position: relative;
    }

    .sidebar ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .sidebar li {
        margin: 8px;
    }

    .sidebar a {
        padding: 12px 18px;
        border-radius: 6px;
    }

    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .main-content {
        margin-left: 0;
    }

    .content {
        padding: 20px 15px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .management-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .page-title {
        font-size: 24px;
    }
}

/* 加载数据 */
.loading-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #2c3e50;
    font-size: 16px;
    margin: 0;
}

.opt-btn-group {
    padding: 8px 15px;
    margin: 0 5px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.opt-btn {
    padding: 8px 15px;
    margin: 0 5px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.opt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important;
}

.refresh-btn {
    background: #156AA8;
    color: white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.add-btn {
    background: #FE5E08;
    color: white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* 选项框样式 */
.teacher-select,
.course-select,
.college-select,
.major-select,
.semester-select,
.class-select{
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    background-color: #fff;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-bottom: 20px;
}

/* 修改后的正确写法 */
.teacher-select:hover,
.course-select:hover,
.college-select:hover,
.major-select:hover,
.semester-select:hover,
.class-select:hover {
    border-color: #3498db;
    cursor: pointer;
}

.teacher-select:focus,
.course-select:focus,
.college-select:focus,
.major-select:focus,
.semester-select:focus,
.class-select:focus{
    border-color: #3498db;
    cursor: pointer;
}

